﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Example16.aspx.cs" Inherits="Chapter19.Example16" %>

<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>代码清单 19-16 应用轮廓</title>
    <meta name="author" content="Adam Freeman" />
    <meta name="description" content="A simple example" />
    <link rel="shortcut ico" href="images/favicon.ico" type="image/x-ico" />
    <style type="text/css">
        p {
            width: 30%;
            padding: 5px;
            border: medium double black;
            background-color: lightgray;
            float: left;
        }

        #fruittext {
            outline: thick solid red;
        }
    </style>
</head>
<body>
    <p>
        There are lots of different kinds of fruit - there are you over 500 varieties
        of banana alone. By the time we add the countless types of apples, oranges,
        and other well-known fruit, we are faced with thousands of choices.
    </p>
    <p id="fruittext">
        There are lots of different kinds of fruit - there are you over 500 varieties
        of banana alone. By the time we add the countless types of apples, oranges,
        and other well-known fruit, we are faced with thousands of choices.
    </p>
    <p>
        There are lots of different kinds of fruit - there are you over 500 varieties
        of banana alone. By the time we add the countless types of apples, oranges,
        and other well-known fruit, we are faced with thousands of choices.
    </p>
    <button>Outline Off</button>
    <button>Outline on</button>
    <script>
        var buttons = document.getElementsByTagName("button");
        for (var i = 0; i < buttons.length; i++) {
            buttons[i].onclick = function (e) {
                var element = document.getElementById("fruittext");
                if (e.target.innerHTML == "Outline Off") {
                    element.style.outline = "none";
                } else {
                    element.style.outlineColor = "red";
                    element.style.outlineStyle = "solid";
                    element.style.outlineWidth = "thinck";
                }
            };
        }
    </script>
</body>
</html>
